package ym.ecrm.core.domain.customerManagement;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.DiscriminatorColumn;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;

import ym.ecrm.core.domain.base.BaseEntity;
import ym.ecrm.core.domain.systemManagement.User;
/**
 * 客户基类
 * @author fage
 *@version 1.0
 */

@Entity
@Inheritance(strategy=InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(name="type",length=10)
@DiscriminatorValue("base")
public class Customer extends BaseEntity{
	/**
	 * customerCode 客户编号
	 */
	@Column(length = 60)
	private String  customerCode;
	/**
	 * customerName 客户名称/姓名
	 */
	@Column(length = 60)
	private String  customerName;
	/**
	 * source 客户来源
	 */
	@Column(length = 60)
	private String  source;
	/**
	 * profession 行业
	 */
	@Column(length = 60)
	private String profession;
	/**
	 * locality 地区/省份
	 */
	@Column(length = 60)
	private String locality;
	/**
	 * city 城市
	 */
	@Column(length = 60)
	private String city;
	/**
	 * postCode 邮编
	 */
	@Column(length = 60)
	private String postCode;
	/**
	 * address 地址
	 */
	@Column(length = 260)
	private String address;
	/**
	 * telePhone 电话
	 */
	@Column(length = 60)
	private String telePhone;
	/**
	 * fax 传真
	 */
	@Column(length = 60)
	private String fax;
	/**
	 * email 邮箱
	 */
	@Column(length = 60)
	private String email;
	
	/**
	 * user 所有人
	 */
		    @ManyToOne(targetEntity = User.class
			           ,cascade={CascadeType.PERSIST,CascadeType.MERGE})
			@JoinColumn(name="userId")
		private User user;

		    
	
	public String getCustomerCode() {
		return customerCode;
	}
	public void setCustomerCode(String customerCode) {
		this.customerCode = customerCode;
	}
	public String getCustomerName() {
		return customerName;
	}
	public void setCustomerName(String customerName) {
		this.customerName = customerName;
	}
	public String getSource() {
		return source;
	}
	public void setSource(String source) {
		this.source = source;
	}
	public String getProfession() {
		return profession;
	}
	public void setProfession(String profession) {
		this.profession = profession;
	}
	public String getLocality() {
		return locality;
	}
	public void setLocality(String locality) {
		this.locality = locality;
	}
	public String getCity() {
		return city;
	}
	public void setCity(String city) {
		this.city = city;
	}
	public String getPostCode() {
		return postCode;
	}
	public void setPostCode(String postCode) {
		this.postCode = postCode;
	}
	public String getAddress() {
		return address;
	}
	public void setAddress(String address) {
		this.address = address;
	}
	public String getTelePhone() {
		return telePhone;
	}
	public void setTelePhone(String telePhone) {
		this.telePhone = telePhone;
	}
	public String getFax() {
		return fax;
	}
	public void setFax(String fax) {
		this.fax = fax;
	}
	public String getEmail() {
		return email;
	}
	public void setEmail(String email) {
		this.email = email;
	}
	public User getUser() {
		return user;
	}
	public void setUser(User user) {
		this.user = user;
	}

	
}
